﻿do
	IGAS:NewAddon("IGAS_Studio")

	local _DB

	------------------------------------------------------------
	-- ScriptType
	------------------------------------------------------------
	_DB = CreateHelpDB(IGAS.GUI.Widget.UIObject, "ScriptType")

	_DB:AddCodeHelp("OnAnimFinished", [[Run when the model's animation finishes]], [[OnAnimFinished()]])
	_DB:AddCodeHelp("OnAttributeChanged", [[Run when a frame attribute is changed]], [[OnAttributeChanged(name, value)]])
	_DB:AddCodeHelp("OnChar", [[Run for each text character typed in the frame]], [[OnChar(text)]])
	_DB:AddCodeHelp("OnCharComposition", [[Run when the edit box's input composition mode changes]], [[OnCharComposition(text)]])
	_DB:AddCodeHelp("OnClick", [[Run when the button is clicked]], [[OnClick(button, down)]])
	_DB:AddCodeHelp("OnColorSelect", [[Run when the color select frame's color selection changes]], [[OnColorSelect(r, g, b)]])
	_DB:AddCodeHelp("OnCursorChanged", [[Run when the position of the text insertion cursor in the edit box changes]], [[OnCursorChanged(x, y, width, height)]])
	_DB:AddCodeHelp("OnDisable", [[Run when the frame is disabled]], [[OnDisable()]])
	_DB:AddCodeHelp("OnDoubleClick", [[Run when the button is double-clicked]], [[OnDoubleClick(button)]])
	_DB:AddCodeHelp("OnDragStart", [[Run when the mouse is dragged starting in the frame]], [[OnDragStart(button)]])
	_DB:AddCodeHelp("OnDragStop", [[Run when the mouse button is released after a drag started in the frame]], [[OnDragStop()]])
	_DB:AddCodeHelp("OnEditFocusGained", [[Run when the edit box becomes focused for keyboard input]], [[OnEditFocusGained()]])
	_DB:AddCodeHelp("OnEditFocusLost", [[Run when the edit box loses keyboard input focus]], [[OnEditFocusLost()]])
	_DB:AddCodeHelp("OnEnable", [[Run when the frame is enabled]], [[OnEnable()]])
	_DB:AddCodeHelp("OnEnter", [[Run when the mouse cursor enters the frame's interactive area]], [[OnEnter(motion)]])
	_DB:AddCodeHelp("OnEnterPressed", [[Run when the Enter (or Return) key is pressed while the edit box has keyboard focus]], [[OnEnterPressed()]])
	_DB:AddCodeHelp("OnEscapePressed", [[Run when the Escape key is pressed while the edit box has keyboard focus]], [[OnEscapePressed()]])
	_DB:AddCodeHelp("OnEvent", [[Run whenever an event fires for which the frame is registered]], [[OnEvent(event, ...)]])
	_DB:AddCodeHelp("OnFinished", [[Run when the animation (or animation group) finishes animating]], [[OnFinished(requested)]])
	_DB:AddCodeHelp("OnHide", [[Run when the frame's visbility changes to hidden]], [[OnHide()]])
	_DB:AddCodeHelp("OnHorizontalScroll", [[Run when the scroll frame's horizontal scroll position changes]], [[OnHorizontalScroll(offset)]])
	_DB:AddCodeHelp("OnHyperlinkClick", [[Run when the mouse clicks a hyperlink in the scrolling message frame or SimpleHTML frame]], [[OnHyperlinkClick(linkData, link, button)]])
	_DB:AddCodeHelp("OnHyperlinkEnter", [[Run when the mouse moves over a hyperlink in the scrolling message frame or SimpleHTML frame]], [[OnHyperlinkEnter(linkData, link)]])
	_DB:AddCodeHelp("OnHyperlinkLeave", [[Run when the mouse moves away from a hyperlink in the scrolling message frame or SimpleHTML frame]], [[OnHyperlinkLeave(linkData, link)]])
	_DB:AddCodeHelp("OnInputLanguageChanged", [[Run when the edit box's language input mode changes]], [[OnInputLanguageChanged(language)]])
	_DB:AddCodeHelp("OnKeyDown", [[Run when a keyboard key is pressed if the frame is keyboard enabled]], [[OnKeyDown(key)]])
	_DB:AddCodeHelp("OnKeyUp", [[Run when a keyboard key is released if the frame is keyboard enabled]], [[OnKeyUp(key)]])
	_DB:AddCodeHelp("OnLeave", [[Run when the mouse cursor leaves the frame's interactive area]], [[OnLeave(motion)]])
	_DB:AddCodeHelp("OnLoad", [[Run when the frame is created]], [[OnLoad()]])
	_DB:AddCodeHelp("OnLoop", [[Run when the animation group's loop state changes]], [[OnLoop(loopState)]])
	_DB:AddCodeHelp("OnMessageScrollChanged", [[Run when the scrolling message frame's scroll position changes]], [[OnMessageScrollChanged()]])
	_DB:AddCodeHelp("OnMinMaxChanged", [[Run when the slider's or status bar's minimum and maximum values change]], [[OnMinMaxChanged(min, max)]])
	_DB:AddCodeHelp("OnMouseDown", [[Run when a mouse button is pressed while the cursor is over the frame]], [[OnMouseDown(button)]])
	_DB:AddCodeHelp("OnMouseUp", [[Run when the mouse button is released following a mouse down action in the frame]], [[OnMouseUp(button)]])
	_DB:AddCodeHelp("OnMouseWheel", [[Run when the frame receives a mouse wheel scrolling action]], [[OnMouseWheel(delta)]])
	_DB:AddCodeHelp("OnMovieFinished", [[Run when a movie frame's movie ends]], [[OnMovieFinished()]])
	_DB:AddCodeHelp("OnMovieHideSubtitle", [[Runs when the movie's most recently displayed subtitle should be hidden]], [[OnMovieHideSubtitle()]])
	_DB:AddCodeHelp("OnMovieShowSubtitle", [[Runs when a subtitle for the playing movie should be displayed]], [[OnMovieShowSubtitle(text)]])
	_DB:AddCodeHelp("OnPause", [[Run when the animation (or animation group) is paused]], [[OnPause()]])
	_DB:AddCodeHelp("OnPlay", [[Run when the animation (or animation group) begins to play]], [[OnPlay()]])
	_DB:AddCodeHelp("OnReceiveDrag", [[Run when the mouse button is released after dragging into the frame]], [[OnReceiveDrag()]])
	_DB:AddCodeHelp("OnScrollRangeChanged", [[Run when the scroll frame's scroll position is changed]], [[OnScrollRangeChanged(xOffset, yOffset)]])
	_DB:AddCodeHelp("OnShow", [[Run when the frame becomes visible]], [[OnShow()]])
	_DB:AddCodeHelp("OnSizeChanged", [[Run when a frame's size changes]], [[OnSizeChanged(width, height)]])
	_DB:AddCodeHelp("OnSpacePressed", [[Run when the space bar is pressed while the edit box has keyboard focus]], [[OnSpacePressed()]])
	_DB:AddCodeHelp("OnStop", [[Run when the animation (or animation group) is stopped]], [[OnStop(requested)]])
	_DB:AddCodeHelp("OnTabPressed", [[Run when the Tab key is pressed while the edit box has keyboard focus]], [[OnTabPressed()]])
	_DB:AddCodeHelp("OnTextChanged", [[Run when the edit box's text is changed]], [[OnTextChanged(isUserInput)]])
	_DB:AddCodeHelp("OnTextSet", [[Run when the edit box's text is set programmatically]], [[OnTextSet()]])
	_DB:AddCodeHelp("OnTooltipAddMoney", [[Run when an amount of money should be added to the tooltip]], [[OnTooltipAddMoney(amount, maxAmount)]])
	_DB:AddCodeHelp("OnTooltipCleared", [[Run when the tooltip is hidden or its content is cleared]], [[OnTooltipCleared()]])
	_DB:AddCodeHelp("OnTooltipSetAchievement", [[Run when the tooltip is filled with information about an achievement]], [[OnTooltipSetAchievement()]])
	_DB:AddCodeHelp("OnTooltipSetDefaultAnchor", [[Run when the tooltip is repositioned to its default anchor location]], [[OnTooltipSetDefaultAnchor()]])
	_DB:AddCodeHelp("OnTooltipSetEquipmentSet", [[Run when the tooltip is filled with information about an equipment set]], [[OnTooltipSetEquipmentSet()]])
	_DB:AddCodeHelp("OnTooltipSetFrameStack", [[Run when the tooltip is filled with a list of frames under the mouse cursor]], [[OnTooltipSetFrameStack()]])
	_DB:AddCodeHelp("OnTooltipSetItem", [[Run when the tooltip is filled with information about an item]], [[OnTooltipSetItem()]])
	_DB:AddCodeHelp("OnTooltipSetQuest", [[Run when the tooltip is filled with information about a quest]], [[OnTooltipSetQuest()]])
	_DB:AddCodeHelp("OnTooltipSetSpell", [[Run when the tooltip is filled with information about a spell]], [[OnTooltipSetSpell()]])
	_DB:AddCodeHelp("OnTooltipSetUnit", [[Run when the tooltip is filled with information about a unit]], [[OnTooltipSetUnit()]])
	_DB:AddCodeHelp("OnUpdate", [[Run each time the screen is drawn by the game engine]], [[OnUpdate(elapsed)]])
	_DB:AddCodeHelp("OnUpdateModel", [[Run when a model changes or animates]], [[OnUpdateModel()]])
	_DB:AddCodeHelp("OnValueChanged", [[Run when the slider's or status bar's value changes]], [[OnValueChanged(value)]])
	_DB:AddCodeHelp("OnVerticalScroll", [[Run when the scroll frame's vertical scroll position changes]], [[OnVerticalScroll(offset)]])
	_DB:AddCodeHelp("PostClick", [[Run immediately following the button's `OnClick` handler with the same arguments]], [[PostClick(button, down)]])
	_DB:AddCodeHelp("PreClick", [[Run immediately before the button's `OnClick` handler with the same arguments]], [[PreClick(button, down)]])
	------------------------------------------------------------
	-- Function
	------------------------------------------------------------
	_DB = CreateHelpDB(IGAS.GUI.Widget.UIObject, "Function")

	_DB:AddCodeHelp("StackScript", [=[Stack a handler to the given script type]=], [=[StackScript(scriptType, handler)]=])
	_DB:AddCodeHelp("GetObjectType", [=[Get the type of this object.]=], [=[GetObjectType()]=])
	_DB:AddCodeHelp("GetChilds", [=[Get the child list of the frame,IMPORTAND, don't do any change to the return table unless you know much about the igas system]=], [=[GetChilds()]=])
	_DB:AddCodeHelp("HasChilds", [=[Check if the frame has childs]=], [=[HasChilds()]=])
	_DB:AddCodeHelp("SetAlpha", [=[Sets the opacity of the region relative to its parent]=], [=[SetAlpha(alpha)]=])
	_DB:AddCodeHelp("IsObjectType", [=[Determine if this object is of the specified type, or a subclass of that type.]=], [=[IsObjectType(type)]=])
	_DB:AddCodeHelp("IsIGASFrame", [=[Determine if this frame is created from igas, always true]=], [=[IsIGASFrame()]=])
	_DB:AddCodeHelp("GetChild", [=[Get the child of the given name]=], [=[GetChild(name)]=])
	_DB:AddCodeHelp("HasScript", [=[Returns whether the widget supports a script handler]=], [=[HasScript(scriptType)]=])
	_DB:AddCodeHelp("SetScript", [=[Sets the widget's handler function for a script]=], [=[SetScript(scriptType, handler)]=])
	_DB:AddCodeHelp("GetAlpha", [=[Returns the opacity of the region relative to its parent]=], [=[GetAlpha()]=])
	_DB:AddCodeHelp("GetParent", [=[Get the parent of this frame (The object, not just the name)]=], [=[GetParent()]=])
	_DB:AddCodeHelp("GetName", [=[Return the name of the object.]=], [=[GetName()]=])
	_DB:AddCodeHelp("GetScript", [=[Returns the widget's handler function for a script]=], [=[GetScript(scriptType)]=])
	_DB:AddCodeHelp("CallMethod", [=[Using for call sup-type methods for this frame]=], [=[CallMethod(widget, method)]=])
	_DB:AddCodeHelp("SetParent", [=[Set the parent for this frame]=], [=[SetParent(parent)]=])
	_DB:AddCodeHelp("SetName", [=[ Set the name of the object.]=], [=[SetName(name)]=])
	_DB:AddCodeHelp("RemoveChild", [=[Remove the child of the given name]=], [=[RemoveChild(child)]=])
	_DB:AddCodeHelp("UnStackScript", [=[Unstack a handler from the given script]=], [=[UnStackScript(scriptType, handler]=])
	_DB:AddCodeHelp("Fire", [=[Fire script, to trigger the frame's script handlers]=], [=[Fire(scriptType, ...)]=])
	_DB:AddCodeHelp("AddChild", [=[Add a child to the frame]=], [=[AddChild(child)]=])
	_DB:AddCodeHelp("Dispose", [=[Release resource, will dipose it's childs the same time]=], [=[Dispose()]=])
	------------------------------------------------------------
	-- Property
	------------------------------------------------------------
	_DB = CreateHelpDB(IGAS.GUI.Widget.UIObject, "Property")

	_DB:AddCodeHelp("Parent", [[Set or Get the frame's parent]], IGAS:GetPropertyType("UIObject"))
	_DB:AddCodeHelp("Name", [[Set or get the frame's name, it's an unique identify in it's parent's childs]], IGAS:GetPropertyType("string"))
	_DB:AddCodeHelp("InDesignMode", [[Check if the frame is under design]], IGAS:GetPropertyType("boolean"))
end
